﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;

namespace Idlesoft.ShellAnywhere.ViewModel
{
	public class OutputItemsViewModel : DependencyObject
	{
		#region ctors
		static OutputItemsViewModel()
		{
			ColorProperty = DependencyProperty.Register("Color", typeof(Brush), typeof(OutputItemsViewModel), new UIPropertyMetadata(Brushes.Black), ColorValidateCallback);
			EntryProperty = DependencyProperty.Register("Entry", typeof(string), typeof(OutputItemsViewModel), new UIPropertyMetadata(""), EntryValidateCallback);
			TimeProperty = DependencyProperty.Register("Time", typeof(DateTime), typeof(OutputItemsViewModel), new UIPropertyMetadata(DateTime.Now), TimeValidateCallback);
		}
		public OutputItemsViewModel(Brush color, string entry) { Color = color; Entry = entry; Time = DateTime.Now; }
		public OutputItemsViewModel(Brush color, string entry, DateTime time) : this(color, entry) { Time = time; }
		#endregion ctors

		#region props
		private static readonly DependencyProperty ColorProperty;
		public Brush Color
		{
			get { return (Brush)GetValue(ColorProperty); }
			set { SetValue(ColorProperty, value); }
		}
		private static readonly DependencyProperty EntryProperty;
		public string Entry
		{
			get { return (string)GetValue(EntryProperty); }
			set { SetValue(EntryProperty, value); }
		}

		private static readonly DependencyProperty TimeProperty;
		public DateTime Time
		{
			get { return (DateTime)GetValue(TimeProperty); }
			set { SetValue(TimeProperty, value); }
		}
		#endregion props

		#region methods
		private static bool ColorValidateCallback(object value)
		{
			Brush color = value as Brush;
			return true;
		}
		private static bool EntryValidateCallback(object value)
		{
			string entry = value as string;
			return true;
		}
		private static bool TimeValidateCallback(object value)
		{
			DateTime time = (DateTime)value;
			return true;
		}
		#endregion methods

		#region events
		#endregion events

		#region fields
		
		#endregion fields
	}
}
